home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / PInterfaces / GXEnvironment.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  7.7 KB  |  245 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        GXEnvironment.p
  3.  
  4.      Contains:    QuickDraw GX environment constants and interfaces
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT GXEnvironment;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __GXENVIRONMENT__}
  30. {$SETC __GXENVIRONMENT__ := 1}
  31.  
  32. {$I+}
  33. {$SETC GXEnvironmentIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __CONDITIONALMACROS__}
  38. {$I ConditionalMacros.p}
  39. {$ENDC}
  40.  
  41. {$IFC UNDEFINED __MIXEDMODE__}
  42. {$I MixedMode.p}
  43. {$ENDC}
  44. {    Types.p                                                        }
  45.  
  46. {$IFC UNDEFINED __WINDOWS__}
  47. {$I Windows.p}
  48. {$ENDC}
  49. {    Memory.p                                                    }
  50. {    Quickdraw.p                                                    }
  51. {        QuickdrawText.p                                            }
  52. {    Events.p                                                    }
  53. {        OSUtils.p                                                }
  54. {    Controls.p                                                    }
  55. {        Menus.p                                                    }
  56.  
  57. {$IFC UNDEFINED __GXTYPES__}
  58. {$I GXTypes.p}
  59. {$ENDC}
  60. {    GXMath.p                                                    }
  61. {        FixMath.p                                                }
  62.  
  63. {$IFC UNDEFINED __CMAPPLICATION__}
  64. {$I CMApplication.p}
  65. {$ENDC}
  66. {    Files.p                                                        }
  67. {        Finder.p                                                }
  68. {    Printing.p                                                    }
  69. {        Errors.p                                                }
  70. {        Dialogs.p                                                }
  71. {            TextEdit.p                                            }
  72. {    CMICCProfile.p                                                }
  73.  
  74. {$PUSH}
  75. {$ALIGN MAC68K}
  76. {$LibExport+}
  77. {$SETC graphicsMacintoshIncludes := 1}
  78.  
  79. CONST
  80.     defaultPollingHandlerFlags    = $00;
  81.     okToSwitchDuringPollFlag    = $00;
  82.     dontSwitchDuringPollFlag    = $01;
  83.  
  84.     
  85. TYPE
  86.     gxPollingHandlerFlags = LONGINT;
  87.  
  88.     gxPollingHandlerProcPtr = ProcPtr;  { PROCEDURE gxPollingHandler(reference: LONGINT; flags: gxPollingHandlerFlags); }
  89.     gxPollingHandlerUPP = UniversalProcPtr;
  90.  
  91. CONST
  92.     uppgxPollingHandlerProcInfo = $000003C1; { PROCEDURE (4 byte param, 4 byte param); }
  93.  
  94. FUNCTION NewgxPollingHandlerProc(userRoutine: gxPollingHandlerProcPtr): gxPollingHandlerUPP;
  95.     {$IFC NOT GENERATINGCFM }
  96.     INLINE $2E9F;
  97.     {$ENDC}
  98.  
  99. PROCEDURE CallgxPollingHandlerProc(reference: LONGINT; flags: gxPollingHandlerFlags; userRoutine: gxPollingHandlerUPP);
  100.     {$IFC NOT GENERATINGCFM}
  101.     INLINE $205F, $4E90;
  102.     {$ENDC}
  103.  
  104. FUNCTION GXGetGraphicsPollingHandler(VAR reference: LONGINT): gxPollingHandlerUPP; C;
  105. PROCEDURE GXSetGraphicsPollingHandler(handler: gxPollingHandlerUPP; reference: LONGINT); C;
  106. {$SETC graphicsToolboxIncludes := 1}
  107. { QD to QD GX Translator typedefs }
  108.  
  109. CONST
  110.     gxDefaultOptionsTranslation    = $0000;
  111.     gxOptimizedTranslation        = $0001;
  112.     gxReplaceLineWidthTranslation = $0002;
  113.     gxSimpleScalingTranslation    = $0004;
  114.     gxSimpleGeometryTranslation    = $0008;                        { implies simple scaling }
  115.     gxSimpleLinesTranslation    = $000C;                        { implies simple geometry & scaling }
  116.     gxLayoutTextTranslation        = $0010;                        { turn on gxLine layout (normally off) }
  117.     gxRasterTargetTranslation    = $0020;
  118.     gxPostScriptTargetTranslation = $0040;
  119.     gxVectorTargetTranslation    = $0080;
  120.  
  121.     
  122. TYPE
  123.     gxTranslationOption = LONGINT;
  124.  
  125.  
  126. CONST
  127.     gxContainsFormsBegin        = $0001;
  128.     gxContainsFormsEnd            = $0002;
  129.     gxContainsPostScript        = $0004;
  130.     gxContainsEmptyPostScript    = $0008;
  131.  
  132.     
  133. TYPE
  134.     gxTranslationStatistic = LONGINT;
  135.  
  136.  
  137. CONST
  138.     gxQuickDrawPictTag            = 'pict';
  139.  
  140.  
  141. TYPE
  142.     gxQuickDrawPict = RECORD
  143.         { translator inputs }
  144.         options:                gxTranslationOption;
  145.         srcRect:                Rect;
  146.         styleStretch:            Point;
  147.         { size of quickdraw picture data }
  148.         dataLength:                LONGINT;
  149.         { file alias }
  150.         alias:                    gxBitmapDataSourceAlias;
  151.     END;
  152.  
  153. { WindowRecord utilities }
  154.  
  155. FUNCTION GXNewWindowViewPort(qdWindow: WindowPtr): gxViewPort; C;
  156. FUNCTION GXGetWindowViewPort(qdWindow: WindowPtr): gxViewPort; C;
  157. FUNCTION GXGetViewPortWindow(portOrder: gxViewPort): WindowPtr; C;
  158. { GDevice utilities }
  159. FUNCTION GXGetViewDeviceGDevice(theDevice: gxViewDevice): GDHandle; C;
  160. FUNCTION GXGetGDeviceViewDevice(qdGDevice: GDHandle): gxViewDevice; C;
  161. { gxPoint utilities }
  162. PROCEDURE GXConvertQDPoint({CONST}VAR shortPt: Point; portOrder: gxViewPort; VAR fixedPt: gxPoint); C;
  163. { printing utilities typedef }
  164. TYPE
  165.     gxShapeSpoolProcPtr = ProcPtr;  { FUNCTION gxShapeSpool(toSpool: gxShape; refCon: LONGINT): OSErr; }
  166.     gxUserViewPortFilterProcPtr = ProcPtr;  { PROCEDURE gxUserViewPortFilter(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT); }
  167.     gxConvertQDFontProcPtr = ProcPtr;  { FUNCTION gxConvertQDFont(dst: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; }
  168.     gxShapeSpoolUPP = UniversalProcPtr;
  169.     gxUserViewPortFilterUPP = UniversalProcPtr;
  170.     gxConvertQDFontUPP = UniversalProcPtr;
  171.  
  172. CONST
  173.     uppgxShapeSpoolProcInfo = $000003E1; { FUNCTION (4 byte param, 4 byte param): 2 byte result; }
  174.     uppgxUserViewPortFilterProcInfo = $00000FC1; { PROCEDURE (4 byte param, 4 byte param, 4 byte param); }
  175.     uppgxConvertQDFontProcInfo = $00000FF1; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  176.  
  177. FUNCTION NewgxShapeSpoolProc(userRoutine: gxShapeSpoolProcPtr): gxShapeSpoolUPP;
  178.     {$IFC NOT GENERATINGCFM }
  179.     INLINE $2E9F;
  180.     {$ENDC}
  181.  
  182. FUNCTION NewgxUserViewPortFilterProc(userRoutine: gxUserViewPortFilterProcPtr): gxUserViewPortFilterUPP;
  183.     {$IFC NOT GENERATINGCFM }
  184.     INLINE $2E9F;
  185.     {$ENDC}
  186.  
  187. FUNCTION NewgxConvertQDFontProc(userRoutine: gxConvertQDFontProcPtr): gxConvertQDFontUPP;
  188.     {$IFC NOT GENERATINGCFM }
  189.     INLINE $2E9F;
  190.     {$ENDC}
  191.  
  192. FUNCTION CallgxShapeSpoolProc(toSpool: gxShape; refCon: LONGINT; userRoutine: gxShapeSpoolUPP): OSErr;
  193.     {$IFC NOT GENERATINGCFM}
  194.     INLINE $205F, $4E90;
  195.     {$ENDC}
  196.  
  197. PROCEDURE CallgxUserViewPortFilterProc(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT; userRoutine: gxUserViewPortFilterUPP);
  198.     {$IFC NOT GENERATINGCFM}
  199.     INLINE $205F, $4E90;
  200.     {$ENDC}
  201.  
  202. FUNCTION CallgxConvertQDFontProc(dst: gxStyle; txFont: LONGINT; txFace: LONGINT; userRoutine: gxConvertQDFontUPP): LONGINT;
  203.     {$IFC NOT GENERATINGCFM}
  204.     INLINE $205F, $4E90;
  205.     {$ENDC}
  206.     
  207. TYPE
  208.     gxShapeSpoolFunction = gxShapeSpoolUPP;
  209.  
  210.     gxUserViewPortFilter = gxUserViewPortFilterUPP;
  211.  
  212.     gxConvertQDFontFunction = gxConvertQDFontUPP;
  213.  
  214. { mouse utilities }
  215. { return mouse location in fixed-gxPoint global space }
  216.  
  217. PROCEDURE GXGetGlobalMouse(VAR globalPt: gxPoint); C;
  218. { return fixed-gxPoint local mouse (gxViewPort == 0 --> default) }
  219. PROCEDURE GXGetViewPortMouse(portOrder: gxViewPort; VAR localPt: gxPoint); C;
  220. { printing utilities }
  221. FUNCTION GXGetViewPortFilter(portOrder: gxViewPort; VAR refCon: LONGINT): gxUserViewPortFilter; C;
  222. PROCEDURE GXSetViewPortFilter(portOrder: gxViewPort; filter: gxUserViewPortFilter; refCon: LONGINT); C;
  223. { QD to QD GX Translator functions }
  224. PROCEDURE GXInstallQDTranslator(port: GrafPtr; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStrech: Point; userFunction: gxShapeSpoolUPP; reference: UNIV Ptr); C;
  225. FUNCTION GXRemoveQDTranslator(port: GrafPtr; VAR statistic: gxTranslationStatistic): gxTranslationStatistic; C;
  226. FUNCTION GXConvertPICTToShape(pict: PicHandle; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStretch: Point; destination: gxShape; VAR stats: gxTranslationStatistic): gxShape; C;
  227. { Find the best GX style given a QD font and face. Called by the QD->GX translator }
  228. FUNCTION GXConvertQDFont(theStyle: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C;
  229. FUNCTION GXGetConvertQDFont: gxConvertQDFontUPP; C;
  230. PROCEDURE GXSetConvertQDFont(userFunction: gxConvertQDFontUPP); C;
  231. { ColorSync 2.0 interface related routines }
  232. PROCEDURE GXSetColorProfileReference(profile: gxColorProfile; reference: CMProfileRef); C;
  233. FUNCTION GXGetColorProfileReference(profile: gxColorProfile): CMProfileRef; C;
  234.  
  235. {$ALIGN RESET}
  236. {$POP}
  237.  
  238. {$SETC UsingIncludes := GXEnvironmentIncludes}
  239.  
  240. {$ENDC} {__GXENVIRONMENT__}
  241.  
  242. {$IFC NOT UsingIncludes}
  243.  END.
  244. {$ENDC}
  245.